package com.qijian.maindata.domain.vo;

import com.qijian.tool.utils.BigDecimalCal;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;

/***
 * 生产进度-工单统计 饼图
 */
@Data
public class ProcessOrderRateCategoryVo {


    private String costFactory;

    @ApiModelProperty("工序名")
    private String processTypeName;

    @ApiModelProperty("总工单数量")
    private Integer totalOrder;

    @ApiModelProperty("已完成工单数量")
    private Integer finishedOrder;

    //成本
    private BigDecimal contentCost;

    private BigDecimal rate;

    public BigDecimal getRate(){
        if(this.rate !=null) {
            return this.rate.setScale(2,RoundingMode.HALF_UP);
        }
        return BigDecimal.ZERO;
    }

    public BigDecimal getContentCost() {
        if(this.contentCost != null){
            return this.contentCost.setScale(2, RoundingMode.HALF_UP);
        }
        return BigDecimal.ZERO;
    }
}
